<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="telephone=no" name="format-detection" />
    <title>忘记密码</title>
    <link href="{{ static('css/main.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/style.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/shake.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/font-awesome.min.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/animate.min.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/idangerous.swiper.css') }}" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="{{ static('js/jquery-1.8.3.min.js') }}"></script>
    <script type="text/javascript" src="{{ static('js/wo.js') }}"></script>
</head>
<body style="background-color: #fff !important;">
<div class="warpe">
    <div class="head">
        <a href="#" class="return"><i class="icon-chevron-left"></i> 返回</a>
        忘记密码
    </div>
    <div class="main">
        <div class="regall">
            <div class="reginput">
                <input type="text" placeholder="身份证号/手机号" id="mobile">

{#                <input type="text" placeholder="验证码">#}
{#                <input type="text" placeholder="验证码" style="border-top: .1rem #ededed solid;">#}
{#                <div class="yzmdiv">#}
{#                    <a href="#" id="bt01">获取验证码</a>#}
{#                </div>#}
{#                <div class="yzmdiv">#}
{#                    <img src="{{ static('img/icon_yzm.png') }}">#}
{#                </div>#}
            </div>
            <div class="regTxt">

            </div>
            <div class="id_bth inersest_bth animated bounceIn">
                <a href="#" id="mobile1">下一步</a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var bt01 = document.getElementById("bt01");
    $('#mobile1').click(function () {
        var mobile = $('#mobile').val();
        var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
        if (!myreg.test(mobile)) {
            alert('手机号格式有误');
        } else {
                $.ajax({
                    type : "post",
                    url: '/password/',
                    data: {
                        "mobile": mobile
                    },
                    success: function (data) {
                        {#if (data.errno == "0") {#}
                        alert('验证码已发送');
                        window.location.href = "{{ url('index:password2') }}";
                        {#    }else{#}
                        {#        alert(data.errmsg)#}
                        {#    }#}
                    }
                })
        }
    });

    {#    var send_url = '/sms_codes/';#}
    {#    $.ajax({#}
    {#        type: "GET",#}
    {#        url: send_url,#}
    {#        data : {#}
    {#                "mobile" : mobile#}
    {#            },#}
    {#        success: function (data) {#}
    {#            if (data.errno == "0") {#}
    {#                console.log('success')#}
    {#            } else {#}
    {#                alert(data.errmsg)#}
    {#            }#}
    {#        }#}
    {#    });#}
    {#    bt01.disabled = true;  //当点击后倒计时时候不能点击此按钮#}
    {#    var time = 60;  //倒计时5秒#}
    {#    var timer = setInterval(fun1, 1000);  //设置定时器#}
    {#    function fun1() {#}
    {#        time--;#}
    {#        if (time >= 0) {#}
    {#            bt01.innerHTML = time + "s后重新发送";#}
    {#        } else {#}
    {#            bt01.innerHTML = "重新发送验证码";#}
    {#            bt01.disabled = false;  //倒计时结束能够重新点击发送的按钮#}
    {#            clearTimeout(timer);  //清除定时器#}
    {#            time = 60;  //设置循环重新开始条件#}
    {#        }#}
    {#    }#}

</script>
</body>
</html>